package com.wiscamp.ninechapters.problems.domain.repositories;

import com.wiscamp.ninechapters.problems.domain.models.sheets.Sheet;
import com.wiscamp.ninechapters.problems.domain.models.sheets.SheetDetail;
import com.wiscamp.ninechapters.problems.domain.models.sheets.SheetAnswer;
import jakarta.validation.constraints.Min;
import jakarta.validation.constraints.NotBlank;

import java.time.LocalDateTime;
import java.util.Collection;

public interface SheetRepository {
    Sheet getSheet(long sheetId);

    Sheet getSheetByTask(@Min(0) long taskId);

    Collection<Sheet> getSheetsByUser(long userId);

    int getSheetsQuantityByDate(@NotBlank LocalDateTime startDate, @NotBlank LocalDateTime endDate);

    int getSheetsQuantityByUser(@Min(0) long userId);

    Sheet saveSheet(Sheet sheet);

    SheetDetail saveSheetDetail(SheetDetail sheetDetail);

    SheetAnswer saveSheetAnswer(SheetAnswer sheetAnswer);

    SheetDetail findSheetDetail(@NotBlank Collection<SheetDetail> details, @Min(0) long questionId);

    long getSheetDetailId(@NotBlank Collection<SheetDetail> details, @Min(0) long problemId, @Min(0) long questionId);
}
